#!/bin/sh
# for stop process

source /etc/profile

serverPath=$(cd `dirname $0`;pwd)

procId=$(cat $serverPath/pid)

function isProcExist()
{
	procNum=$(ps -e|awk '{print $1}'|grep ${procId}|wc -l)
        if [ ${procNum} -eq 0 ];then
                echo "${prog} process is not exist."
                exit 1
        else
                return 0
        fi
}

# kill process
kill ${procId}

isProcExist

if [ $? -eq 0 ];then
        echo "${prog} process stop sucessful."
else
        echo "${prog} process stop failed."
	exit 1;
fi
